package com.sf.fy.uav.common.enums;

public enum MspOrderStatusEnum {
    /**
     * 取消对应平台组那边的异常，他们没有异常，只有取消
     */
    TO_BE_PAID(-1, "待付款"),

    PENDING_ITEMS(0, "等待接单"),

    //上门取货中
    DOOR_TO_DOOR_PICKUP(-2, "上门取件中"),
    //无人机已取件
    DRONE_HAS_BEEN_PICKED_UP(-3, "已取件,前往无人机航站中"),

    //插入无人机准备起飞
    DRONE_READY_TO_TAKE_OFF(2, "无人机准备起飞"),

    //无人机配送中
    DRONE_DELIVERY_IN_PROGRESS(-4, "无人机配送中"),


    //无人机已抵达航站
    THE_DRONE_HAS_ARRIVED_AT_THE_TERMINAL(3, "无人机已抵达航站"),

    TO_BE_DISPATCHED(1, "上门派送中"),

    COMPLETED(4, "已完成"),

    //异常状态
    ABNORMAL(5, "异常"),

    CANCEL(6, "已取消"),
    EXPIRE(7, "已取消"),

    CANCEL_BEFORE_PAYMENT(8, "已取消");


    private Integer status;
    private String name;


    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    MspOrderStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public static String getName(Integer status) {
        for (MspOrderStatusEnum ele : values()) {
            if (ele.getStatus().equals(status)) {
                return ele.getName();
            }
        }
        return null;
    }
}
